<?php
declare (strict_types = 1);

namespace app\common\system\logic;

use app\common\BaseLogic;
use app\common\system\model\UserDepartment;

class UserDepartmentLogic extends BaseLogic {

    public function getUserDepartment($userId)
    {
        $model = new UserDepartment();
        return $model->where('user_id', $userId)->column('department_id');
    }

    public function getDptUserIds($dptId) {

        $model = new UserDepartment();
        return $model->where('department_id', '=', $dptId)->column('user_id');
    }
}